Skip to main content

else if

Type

keyword

Summary

Used within an if control structure to evaluate an alternate conditional expression and contain a statement or statement list to be executed if its conditional expression is true.

Syntax

else if <condition> then
<statementList>

Description

Use the else if keyword to add an alternate conditional expression to be evaluated in the if control structure. If the condition evaluates to true then the statement or statement list following the else ifkeyword will be executed.

Parameters

NameTypeDescription

condition

bool

Any expression. (If the condition evaluates to true, the statements execute for that condition. If the condition evaluates to false, the statement or statement list following that condition is skipped.)

statementList

Of one or more LiveCode statements, and can also include if, switch, try, or repeat control structure|control structures.

Examples

if tPH < 7 then
put "acid" into tDescription
else if tPH > 7 then
put "alkaline" into tDescription
else
put "neutral" into tDescription
end if

control structure: if, break, repeat, try

glossary: keyword, control structure, expression

keyword: then, end, else, control

Compatibility and Support

Introduced

LiveCode 1.0

OS

mac

windows

linux

ios

android

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?